package hku.cs.lunuo.cfg;

public class EntityBlk implements Comparable{
	String klassName;
	String methodName;
	int idx;
	
	@Override
	public boolean equals(Object obj) {
		EntityBlk e = (EntityBlk)obj;
		if(klassName.equals(e.klassName)&&methodName.equals(e.methodName)&&idx==e.idx)
			return true;
		else
			return false;
	}

	

	public EntityBlk(String klassName, String methodName, int idx) {
		super();
		this.klassName = klassName;
		this.methodName = methodName;
		this.idx = idx;
	}



	@Override
	public int compareTo(Object o) {
		EntityBlk e = (EntityBlk)o;
		int tmp = this.klassName.compareTo(e.klassName);
		if(tmp == 0) {
			int tmq = this.methodName.compareTo(e.methodName);
			if(tmq == 0)
				return this.idx - e.idx;
			else
				return tmq;
		}else
			return tmp;
	}
}
